import request from '@/utils/request'

export function cateList(query) {
  return request({
    url: '/api/question/cate_list',
    method: 'get',
    params: query
  })
}

export function cateAll() {
  return request({
    url: '/api/question/cate_all',
    method: 'get'
  })
}


export function changeCateStatus(val, id) {
  return request({
    url: '/api/question/change_cate_status',
    method: 'get',
    params: {
      id: id,
      status: val
    }
  })
}

export function delCate(id) {
  return request({
    url: '/api/question/cate_del',
    method: 'get',
    params: { id }
  })
}

export function createCate(data) {
  return request({
    url: '/api/question/create_cate',
    method: 'post',
    data
  })
}

export function createQuestion(data) {
  return request({
    url: '/api/question/create',
    method: 'post',
    data
  })
}

export function detail(id) {
  return request({
    url: '/api/question/detail',
    method: 'get',
    params: { id }
  })
}

export function getList(query) {
  return request({
    url: '/api/question/list',
    method: 'get',
    params: query
  })
}

export function del(id) {
  return request({
    url: '/api/question/del',
    method: 'get',
    params: { id }
  })
}

export function changeStatus(val, id) {
  return request({
    url: '/api/question/change_status',
    method: 'get',
    params: {
      id: id,
      status: val
    }
  })
}

export function fetchService(id) {
  return request({
    url: '/api/service/detail',
    method: 'get',
    params: { id }
  })
}


export function getAll() {
  return request({
    url: '/api/question/all',
    method: 'get'
  })
}
